<template>
  <div class="HotList">
    <dl class="fly-panel fly-list-one">
      <dt class="fly-panel-title">本周热议</dt>
      <dd v-for="(item, index) in weeklist" :key="'weekitem' + index">
        <router-link
          :class="{ link: item.title }"
          :to="{ name: 'detail', params: { tid: item._id } }"
          >{{ item.title }}</router-link
        >
        <span><i class="iconfont icon-pinglun1"></i> {{ item.answer }}</span>
      </dd>

      <!-- 无数据时 -->
      <!--
        <div class="fly-none">没有相关数据</div>
        -->
    </dl>
  </div>
</template>

<script>
import { getHotWeek } from "@/api/content";
export default {
  name: 'HotList',
  data () {
    return {
      weeklist: '',
    }
  },
  mounted () {
    this.hotWeek()
  },
  methods: {
    hotWeek () {
      getHotWeek().then((res) => {
        if (res.code === 200) {
          this.weeklist = res.data
        }
      })
    },
  },
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
.link {
  color: #2f4056;
}
</style>
